import { http } from "@/utils/http";
export const baseUrlApi = (url: string) => `/api/v1/${url}`;

// 定义API响应类型
interface ApiResponse<T> {
  status: string;
  msg?: string;
  data?: T;
}

/** 微信登录
 * @param params 包含微信授权码的参数对象
 * @returns Promise
 */
export const getWxLogin = (params: { code: string }) => {
  return http.request<ApiResponse<any>>("get", baseUrlApi("auth/login"), {
    params
  });
};
/**
 * 解除鉴权限制
 */
export const removeAuthLimit = (code: string) => {
  return http.request<ApiResponse<any>>("get", baseUrlApi("auth/limit"), {
    params: { code }
  });
};

/**
 * 路由相关接口
 * @returns
 */
export const setRoute = (data: any) => {
  return http.request<any>("post", baseUrlApi("route/set"), {
    data: {
      ...data
    }
  });
};

/**
 * 获取路由接口(临时)
 */
export const getRouter = () => {
  return http.request<any>("get", baseUrlApi("route/temp"));
};

/**
 * 获取全部路由接口(正式)
 */
export const getAllRouter = () => {
  return http.request<any>("get", baseUrlApi("route/all"));
};
/**
 * 分页获取路由
 */
export const getRouterByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("route/page"), {
    params: data
  });
};
/**
 * 修改单个路由信息
 */
export const setRoleRouters = (data: any) => {
  return http.request<any>("post", baseUrlApi("/route/role/set"), {
    data: {
      ...data
    }
  });
};
/**
 *给角色批量增加路由
 */
export const setRouter = (data: any) => {
  return http.request<any>("post", baseUrlApi("route/update"), {
    data: {
      ...data
    }
  });
};

/**
 * 权限相关接口
 */

/**
 * 获取所有权限信息
 * @returns
 */
export const getAllPermisson = () => {
  return http.request<any>("get", baseUrlApi("permission/all"));
};

/**
 * 获取自己的权限
 * @returns
 */
export const getMyPermissions = () => {
  return http.request<any>("get", baseUrlApi("permission/mine"));
};

/**
 * 分条件获取权限
 * @returns
 */
export const getPermissionsBy = (data: any) => {
  return http.request<any>("get", baseUrlApi("permission/all"), {
    params: data
  });
};

/**
 * 多条件分页获取权限
 */
export const getPermissionsByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("permission/page"), {
    params: data
  });
};

/**
 * 添加权限
 * @param data
 * @returns
 */
export const addPermission = (data: any) => {
  return http.request<any>("post", baseUrlApi("permission/add"), {
    data: {
      ...data
    }
  });
};

/**
 * 删除权限
 * @param id
 * @returns
 */
export const deletePermission = (id: number) => {
  return http.request<any>("post", baseUrlApi(`permission/del`), {
    data: {
      permission_id: id
    }
  });
};

/**
 * 更新权限
 * @param data 权限信息
 * @returns Promise
 */
export const updatePermission = (data: {
  id: number;
  name: string;
  description: string;
  pid: number;
}) => {
  return http.request<any>("post", baseUrlApi("permission/set"), {
    data
  });
};

/**
 * 角色相关接口
 * @returns
 */
/**
 * 获取所有角色
 */
export const getAllRoles = () => {
  return http.request<any>("get", baseUrlApi("permission/role/all"));
};

/**
 * 获取角色列表
 */
export const getRoleListByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("/permission/role/page"), {
    params: data
  });
};

/**
 * 修改角色权限
 */
export const setRolePermission = (roleId: number, permissionIds: number[]) => {
  return http.request<any>(
    "post",
    baseUrlApi("/permission/role/set/permission"),
    {
      data: {
        role_id: roleId,
        permission_ids: permissionIds
      }
    }
  );
};

/**
 * 修改角色名称描述
 * @param id 角色id
 * @param name 角色名称
 * @param description 角色描述
 * @returns
 */
export const setRoleNameAndDescription = (
  id: number,
  name: string,
  description: string
) => {
  return http.request<any>("post", baseUrlApi("permission/role/set/role"), {
    data: {
      id,
      name,
      description
    }
  });
};

/**
 * 删除角色
 */
export const deleteRole = (id: number) => {
  return http.request<any>("post", baseUrlApi(`permission/role/del/role`), {
    data: {
      role_id: id
    }
  });
};

/**
 * 查询自己的所有角色
 */
export const getMyAdminer = () => {
  return http.request<any>("get", baseUrlApi("permission/role/mine"));
};

/**
 * 管理员相关接口
 */

/**
 * 添加新的管理员
 */
export const addRole = (name: string, description: string) => {
  return http.request<any>("post", baseUrlApi("permission/role/add/role"), {
    data: {
      name,
      description
    }
  });
};

/**
 * 设置管理员角色
 */

export const setAdminerRole = (admin_id: number, role_ids: number[]) => {
  return http.request<any>("post", baseUrlApi("admin/set/role"), {
    data: {
      admin_id,
      role_ids
    }
  });
};

/**
 * 获取所有管理员信息
 * @param url
 * @returns
 */
export const getAdminerList = (data: any) => {
  return http.request<any>("get", baseUrlApi("admin/list"), {
    params: data
  });
};

/**
 * 设置管理员状态（启用/禁用）
 */
export const setAdminerStatus = (admin_id: number, status: number) => {
  return http.request<any>("post", baseUrlApi("admin/disable"), {
    data: {
      admin_id,
      status
    }
  });
};

//日志相关接口
/**
 * 获取登录日志
 * @returns Promise
 */
export const getLoginLogByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("log/login/page"), {
    params: data
  });
};

/**
 * 获取操作日志
 */
export const getOperationLogByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("log/operation/page"), {
    params: data
  });
};

/**
 * 获取全部登录日志
 * @returns
 */
export const getAllLoginLog = () => {
  return http.request<any>("get", baseUrlApi("log/login/all"));
};

/**
 * 获取全部操作日志
 * @returns
 */
export const getAllOperationLog = () => {
  return http.request<any>("get", baseUrlApi("log/operation/all"));
};

/**
 *  表相关接口
 */

/**
 * 获取全部表结构
 */
export const getAllTableField = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/all"), {
    params: data
  });
};

/**
 * 修改表的数据
 */
export const setTableRecord = (data: any) => {
  return http.request<any>("post", baseUrlApi("table/record/update"), {
    data
  });
};
/**
 * 获取自己的表信息
 */
export const getMyTable = () => {
  return http.request<any>("get", baseUrlApi("table/mine"));
};

/**
 * 获取全部表结构
 * @returns
 */
export const getAllTable = () => {
  return http.request<any>("get", baseUrlApi("table/all"));
};

/**
 * 导入表格数据
 */
export const importField = (data: {
  table_id: number;
  data: Record<string, any>[];
}) => {
  return http.request<any>("post", baseUrlApi("table/field/import"), {
    data
  });
};

/**
 * 多条件分页获取表结构数据
 */
export const getTableByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/page"), {
    params: data
  });
};

/**
 * 分页获取表信息
 */
export const getTableInfoByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/page"), {
    params: data
  });
};

/**
 * 添加新字段
 */
export const addTableFiled = (data: {
  table_id: number;
  field: string;
  label: string;
  type: string;
}) => {
  return http.request<any>("post", baseUrlApi("table/field/add"), {
    data
  });
};

/**
 * 修改字段信息
 */
export const setTableFiled = (data: any) => {
  return http.request<any>("post", baseUrlApi("table/field/set"), {
    data
  });
};

/**
 * 查询单个字段信息
 */
export const getTableRecords = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/records"), {
    params: data
  });
};

/**
 * 多条件获取可见范围信息
 */
export const getTableFieldScopeAll = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/scope/all"), {
    params: data
  });
};

/**
 * 新增/修改角色范围限制
 */
export const setTableFieldScope = (data: any) => {
  return http.request<any>("post", baseUrlApi("table/field/scope/set"), {
    data
  });
};

/**
 * 删除数据记录
 */
export const deleteTableRecord = (data: any) => {
  return http.request<any>("post", baseUrlApi("table/field/delete"), {
    data
  });
};

/**
 * 白名单相关接口
 */
/**
 * 多条件分页查询白名单
 */
export const getAllowByPage = (data: {
  page: number;
  size: number;
  id: number;
  number: number;
  name: string;
}) => {
  return http.request<any>("get", baseUrlApi("admin/allow/page"), {
    params: data
  });
};

// 白名单相关接口
interface AddAllowParams {
  number: number;
  name: string;
  allow_ip: string;
}

interface SetAllowParams extends AddAllowParams {
  id: number;
}

interface DelAllowParams {
  id: number;
}

// 添加白名单
export const addAllow = (params: AddAllowParams) => {
  return http.request<any>("post", baseUrlApi("admin/allow/add"), {
    data: params
  });
};

// 更新白名单
export const setAllow = (params: SetAllowParams) => {
  return http.request<any>("post", baseUrlApi("admin/allow/set"), {
    data: params
  });
};

// 删除白名单
export const delAllow = (params: DelAllowParams) => {
  return http.request<any>("post", baseUrlApi("admin/allow/del"), {
    data: params
  });
};

/**
 * 预导入白名单
 */
export const preAllow = (data: any) => {
  return http.request<any>("post", baseUrlApi("admin/allow/adds"), {
    data
  });
};

/**
 * 用户相关接口
 */

/**
 * 获取自己可以查询的用户信息
 */
export const getMyUser = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/mine"), {
    params: data
  });
};

/**
 * 导出excel
 */
export const exportUser = (data: any) => {
  return http.request<any>("get", baseUrlApi("table/field/export"), {
    params: data
  });
};

/**
 * 修改表字段
 */
export const updateTableField = (data: any) => {
  return http.request<any>("post", baseUrlApi("table/field/update"), {
    data
  });
};

/**
 * 机构相关接口
 */
/**
 * 获取全部机构信息
 */
export const getAllInstitution = () => {
  return http.request<any>("get", baseUrlApi("institution/all"));
};

/**
 * 添加机构信息
 */
export const addInstitution = (data: any) => {
  return http.request<any>("post", baseUrlApi("institution/add"), {
    data
  });
};

/**
 * 修改机构信息
 */
export const updateInstitution = (data: any) => {
  return http.request<any>("post", baseUrlApi("institution/update"), {
    data
  });
};

/**
 * 删除机构信息
 */
export const delInstitution = (id: number) => {
  return http.request<any>("post", baseUrlApi("institution/delete"), {
    data: { id }
  });
};

/**
 * 流程相关接口
 */
/**
 * 获取专业管理员
 * @param data
 * @returns
 */
export const getProfessionalAdministrator = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/getProfessionalAdministrator"),
    {
      params: data
    }
  );
};

/**
 * 申请转专业
 */
export const applyForProfessionalTransfer = (data: any) => {
  return http.request<any>(
    "post",
    baseUrlApi("service/applyForProfessionalTransfer"),
    {
      data
    }
  );
};

/**
 * 获取全部专业
 */
export const getAllClasses = (data: any) => {
  return http.request<any>("get", baseUrlApi("service/getClassesAll"), {
    params: data
  });
};

/**
 * 获取可审批的转专业
 */
export const getApprovalOrder = (data: { page: number; size: number }) => {
  return http.request<any>("get", baseUrlApi("service/getApprovalOrder"), {
    params: data
  });
};

/**
 * 审批转专业
 */
export const approvalToSpecialty = (data: any) => {
  return http.request<any>("post", baseUrlApi("service/approvalToSpecialty"), {
    data
  });
};

/**
 * 申请历史相关接口
 */
export const getApprovalHistory = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("/service/getMyInitiatedTransfers"),
    {
      params: data
    }
  );
};

/**
 * 专业相关接口
 */

/**
 * 获取全部专业信息
 * @param data 查询参数 {id?: string, oid?: string, zh_name?: string, class_id?: string}
 */
export const getAllAcademy = (data?: {
  id?: string;
  oid?: string;
  zh_name?: string;
  class_id?: string;
}) => {
  return http.request<any>("get", baseUrlApi("academy/all"), {
    params: data
  });
};

/**
 * 分页获取专业班级列表
 */
export const getAcademyByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("academy/list"), {
    params: data
  });
};

/**
 * 添加新的专业
 * @param data 专业信息
 */
export const addAcademy = (data: {
  oid: string;
  zh_name: string;
  pid: string;
  class_id: number;
  class_name: string;
}) => {
  return http.request<any>("post", baseUrlApi("academy/add"), {
    data
  });
};

/**
 * 更新专业信息
 * @param data 专业信息
 */
export const updateAcademy = (data: {
  id: number;
  oid?: string;
  zh_name?: string;
  pid?: string;
  class_name?: string;
  seqnum_id?: string;
  is_vaild?: number;
}) => {
  return http.request<any>("post", baseUrlApi("academy/update"), {
    data
  });
};

/**
 * 删除专业信息
 * @param id 专业ID
 */
export const deleteAcademy = (id: number) => {
  return http.request<any>("post", baseUrlApi("academy/delete"), {
    data: { id }
  });
};

/**
 * 生成授权码
 */
export const generateCertificateNumber = (data: any) => {
  return http.request<any>(
    "post",
    baseUrlApi("service/generateCertificateNumber"),
    {
      data
    }
  );
};

/**
 * 转部门相关接口
 */

/**
 * 获取全部转部门信息
 */
export const getAllTransferDepartment = (params: any) => {
  return http.request<any>("get", baseUrlApi("service/getDepartmentSection"), {
    params
  });
};

/**
 * 获取部门管理员
 */
export const getDepartmentAdministrator = (params: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/getDepartmentAdministrator"),
    {
      params
    }
  );
};

/**
 * 发起转部门
 */
export const initiateChangeOfDepartment = (data: any) => {
  return http.request<any>(
    "post",
    baseUrlApi("service/initiateChangeOfDepartment"),
    {
      data
    }
  );
};

/**
 * 审批转部门
 */
export const approvalToDepartment = (data: any) => {
  return http.request<any>("post", baseUrlApi("service/approvalToDepartment"), {
    data
  });
};

/**
 * 获取当前管理员可以审批的转部门申请
 */
export const getApprovalOrderDepartment = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/getApprovalOrderDepartment"),
    {
      params: data
    }
  );
};

/**
 * 获取转专业申请历史
 */
export const getChangeDepartmentHistory = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/getMyInitiatedDepartmentTransfers"),
    {
      params: data
    }
  );
};

/**
 * 文件上传接口
 * @param data 包含文件和参数的对象
 * @returns Promise
 */
export const uploadFile = (data: {
  formData: FormData;
  params: { table_id: number };
}) => {
  return http.request<ApiResponse<any>>("post", baseUrlApi("file/upload"), {
    data: data.formData,
    params: data.params,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

/**
 * 公共账号相关接口
 */

/**
 * 分页获取团队列表
 */
export const getTeamByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/page"), {
    params: data
  });
};

/**
 * 更新团队信息
 */
export const updateTeam = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/update"), {
    data
  });
};

/**
 * 审批创建团队
 */
export const approvalCreateTeam = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/approval"), {
    data
  });
};

/**
 * 申请创建团队
 */
export const createTeam = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/create"), {
    data
  });
};

/**
 * 分页查询加入团队申请
 */
export const getpageApplyJoin = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageApplyJoin"), {
    params: data
  });
};

/**
 * 分页获取所有团队
 */
export const getAllTeamByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageAll"), {
    params: data
  });
};

/**
 * 查询申请历史
 */
export const getChangeTeamHistory = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/myApply"), {
    params: data
  });
};

/**
 * 分页获取全部部门申请列表
 */
export const getTeamApplyByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageApply"), {
    params: data
  });
};

//成员相关
/**
 * 分页查询团队成员
 */
export const getTeamMembersByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageMember"), {
    params: data
  });
};

/**
 * 根据成员查询可以使用的公共账号
 */
export const getPageAccountByMember = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageAccountByMember"), {
    params: data
  });
};

/**
 * 直接添加团队成员
 */
export const addTeamMember = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/add"), {
    data
  });
};

/**
 * 审批加入团队
 */
export const approvalJoinTeam = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/approvalJoin"), {
    data
  });
};

/**
 * 添加公共账号成员
 */
export const addAccountMember = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/addAccountMember"), {
    data
  });
};

/**
 * 申请加入团队
 */
export const joinTeam = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/join"), {
    data
  });
};

/**
 * 修改成员的角色
 */
export const updateMemberRole = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/updateMember"), {
    data
  });
};

//账号相关
/**
 * 分页获取公共账号列表
 */
export const getTeamAccountsByPage = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageAccount"), {
    params: data
  });
};

/**
 * 查询公共账号的成员列表
 */
export const getPageMemberByAccount = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageMemberByAccount"), {
    params: data
  });
};

/**
 * 申请创建公共账号
 */
export const createTeamAccount = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/createAccount"), {
    data
  });
};

/**
 * 查看自己申请的公共账号
 */
export const getMyTeamAccount = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageMyAccount"), {
    params: data
  });
};

/**
 * 获取全部的公共账号
 */
export const getAllTeamAccount = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageAllAccount"), {
    params: data
  });
};

/**
 * 审批公共账号
 */
export const approvalTeamAccount = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/approvalAccount"), {
    data
  });
};

/**
 * 分页查询待审批的公共账号
 */
export const getPageApprovalTeamAccount = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageAccountApply"), {
    params: data
  });
};

/**
 * 停用公共账号成员
 */
export const stopAccountMember = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/stopAccountMember"), {
    data
  });
};

/**
 * 成员申请加入公共账号
 */
export const applyJoinTeamAccount = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/applyJoinAccount"), {
    data
  });
};

/**
 * 分页获取加入团队公共账号的申请记录
 */
export const getPageApplyJoinTeamAccount = (data: any) => {
  return http.request<any>("get", baseUrlApi("team/pageApplyJoinAccount"), {
    params: data
  });
};

/**
 * 审批加入团队公共账号
 */
export const approvalJoinTeamAccount = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/approvalJoinAccount"), {
    data
  });
};

/**
 * 启用公共账号
 */
export const startAccountMember = (data: any) => {
  return http.request<any>("post", baseUrlApi("team/startAccountMember"), {
    data
  });
};

/**
 * 教职工借调
 */
export const Secondment = (data: any) => {
  return http.request<any>("post", baseUrlApi("service/loan/Secondment"), {
    data
  });
};

//帮助文档相关接口
/**
 * 分页查询文章
 */
export const getHelpDocumentList = (data: any) => {
  return http.request<any>("get", baseUrlApi("/help/page"), {
    params: data
  });
};

/**
 * 添加文章
 */
export const addHelpDocument = (data: any) => {
  return http.request<any>("post", baseUrlApi("/help/add"), {
    data
  });
};

/**
 * 修改文章
 */
export const updateHelpDocument = (data: any) => {
  return http.request<any>("post", baseUrlApi("help/set"), {
    data
  });
};

//数据统计相关接口
/**
 * 获取数据统计信息
 */
export const getCount = (data: any) => {
  return http.request<any>("get", baseUrlApi("statistics/getCount"), {
    params: data
  });
};

/**
 * 获取统计数据
 */
export const getStatistics = (data: any) => {
  return http.request<any>("get", baseUrlApi("statistics/getStatistics"), {
    params: data
  });
};

//多身份相关接口
/**
 * 获取更改身份必填字段
 */
export const getMultipleIdentityList = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/multiIdentity/getRequiredFields"),
    {
      params: data
    }
  );
};

/**
 * 新增多身份
 */
export const addMultipleIdentity = (data: any) => {
  return http.request<any>(
    "post",
    baseUrlApi("service/multiIdentity/addMultiIdentity"),
    {
      data
    }
  );
};

//查询人员具体信息
export const getPersonnelInfo = (data: any) => {
  return http.request<any>(
    "get",
    baseUrlApi("service/multiIdentity/queryPersonnel"),
    {
      params: data
    }
  );
};

//系统设置相关接口
/**
 * 分页查询所有配置
 */
export const getSystemSetting = (data: any) => {
  return http.request<any>("get", baseUrlApi("config/page"), {
    params: data
  });
};

/**
 * 修改系统设置
 */
export const updateSystemSetting = (data: any) => {
  return http.request<any>("post", baseUrlApi("config/set"), {
    data
  });
};

//专业班级相关接口
/**
 * 获取班级列表
 */
export const getClassPageList = (data: any) => {
  return http.request<any>("get", baseUrlApi("class/page"), {
    params: data
  });
};

/**
 * 获取全部班级
 */
export const getAllClass = () => {
  return http.request<any>("get", baseUrlApi("class/all"));
};

/**
 * 新增班级
 */
export const addClass = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/add"), {
    data
  });
};

/**
 * 修改班级
 */
export const updateClass = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/update"), {
    data
  });
};

/**
 * 删除班级
 */
export const deleteClass = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/delete"), {
    data
  });
};

/**
 * 获取专业列表
 */
export const getProfessionalList = (data: any) => {
  return http.request<any>("get", baseUrlApi("class/major/page"), {
    params: data
  });
};

/**
 * 获取全部专业
 */
export const getAllProfessional = () => {
  return http.request<any>("get", baseUrlApi("class/major/all"));
};

/**
 * 新增专业
 */
export const addProfessional = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/major/add"), {
    data
  });
};

/**
 * 修改专业
 */
export const updateProfessional = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/major/update"), {
    data
  });
};

/**
 * 删除专业
 */
export const deleteProfessional = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/major/delete"), {
    data
  });
};

/**
 * 获取学院列表
 */
export const getAcademyList = (data: any) => {
  return http.request<any>("get", baseUrlApi("class/college/page"), {
    params: data
  });
};

/**
 * 获取全部学院
 */
export const getAllAcademyList = () => {
  return http.request<any>("get", baseUrlApi("class/college/all"));
};

/**
 * 新增学院
 */
export const addAcademyList = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/college/add"), {
    data
  });
};

/**
 * 修改学院
 */
export const updateAcademyList = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/college/update"), {
    data
  });
};

/**
 * 删除学院
 */
export const deleteAcademyList = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/college/delete"), {
    data
  });
};

/**
 * 批量插入班级专业学院
 */
export const addBatchClass = (data: any) => {
  return http.request<any>("post", baseUrlApi("class/batch"), {
    data
  });
};
